package com.ruoyi.web.controller.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * https://www.cnblogs.com/paddix/p/8365558.html
 * https://developer.aliyun.com/article/617307
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private  ApplicationConfiguration configuration;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new SaLoginCheckInterceptor()).addPathPatterns("/api/**").excludePathPatterns(configuration.getExcludeUrls());
    }

}







